package com.codelab.statemachine.task;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.statemachine.persist.DefaultStateMachinePersister;
import org.springframework.statemachine.persist.StateMachinePersister;

@Configuration
public class TaskPersistConfig {
    @Autowired
    private TaskStateMachinePersist taskStateMachinePersist;

    @Bean("taskMachinePersister")
    public StateMachinePersister<TaskStates,TaskEvents,String> taskMachinePersister(){
        return new DefaultStateMachinePersister<TaskStates,TaskEvents,String>(taskStateMachinePersist);
    }
}
